{{ header }}
<div id="account-address" class="container">
	{#{{ include(helper.template('_partial/breadcrumb')) }}#}
	{% if success %}
		<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}</div>
	{% endif %}
	{% if error_warning %}
		<div class="alert alert-warning"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
	{% endif %}
	<div class="row no-gutters">{{ column_left }}
		{% if column_left and column_right %}
			{% set class = 'col-sm-6' %}
		{% elseif column_left or column_right %}
			{% set class = 'col-sm-9' %}
		{% else %}
			{% set class = 'col-sm-12' %}
		{% endif %}
		<div id="content" class="account-address-list {{ class }}">{{ content_top }}
			<h2 class="account-address-list-title">{{ text_address_book }}</h2>
			{#{{ include(helper.template('account/address_form')) }}#}
			<div class="buttons clearfix  mb-1">
				<div class="pull-right"><a href="{{ add }}" class="btn btn-primary">{{ button_new_address }}</a></div>
			</div>
			{% if addresses %}
				<div class="addresses">
					{% for result in addresses %}
						<div class="addresses-item clearfix">
							<div class="address-item-content">
								{% if result.is_default %}
									<div class="default-address text-center">{{ entry_default }}</div>
								{% endif %}
								<div>{{ result.address }}</div>
							</div>
							<div class="addresses-item-operation">
								<a href="{{ result.update }}" class="addresses-item-operation-edit">{{ button_edit }}</a>
								<a href="{{ result.delete }}" class="addresses-item-operation-delete">{{ button_delete }}</a>
							</div>
						</div>
					{% endfor %}
				</div>
			{% else %}
				<div class="no-items">
					<img src="catalog/view/theme/{{ helper.config('theme_default_directory') }}/image/no_items.png" class="img-responsive">
					<span>{{ text_no_results }}</span>
				</div>
			{% endif %}
			{{ content_bottom }}</div>
		{{ column_right }}</div>
</div>
{{ footer }}


<script>
    $(function () {
        $('.addresses-item-operation-delete').click(function (event) {
            event.preventDefault();
            layer.open({
                skin: 'layer-alert',
                title: ' ',
                shadeClose: true,
                content: '{{ text_confirm_delete }}',
                btn: '{{ text_confirm }}',
                btnAlign: 'c',
                yes: function() {
                    location.href = event.target.href;
                }
            });

        })
    });


</script>